$(function(){
	
	var url = decodeURI(window.location.href.split("?")[1]);
	var id = url.split("id=")[1];
	if(checkLogin()){
		console.log("ont")
		toLogin("?html=resumeView.html")
		return;
	}else{
console.log("yse")
		$.ajax({
			url: path + "user/selectJianliAllInfoByUserId",
			type: "POST",
			data: {"userId": id},
			dataType: "json",
			crossDomain: true,
			xhrFields: {
				withCredentials: true
			},
			async: false,
		}).done(function(data) {
			if (data.hrefLocation != undefined) {
				window.location.href= data.hrefLocation
			}else{
				j = data.jianLi
				u = data.user
				e= data.education
				h = data.hopeWork
				w = data.workExperience
				m = data.myRemark
				p = data.projectExperience
				v = data.workView
				
				$("#baseInfo").html(j.name + " | " + j.gender + " | " + j.topDegree + " | " +j.workyear + " | " + h.city + " <br> "
				+ w.positionName + " " + w.companyName + " | " + j.topDegree + " " + e.schoolName + "<br>" 
				+ j.tel + " | " + j.email)
				
				$("#headIco").attr("src", path+data.headIco)
				
				$("#headIco").attr("crossorigin", "Anonymous")
				
				$("#hopeWork").html(h.city + " ,123 " + h.positionType + " , " + h.salary + " , " + h.positionName)
				
				$("#workYear").html(w.startWorkYear+"."+w.startWorkMonth+"-"+w.endWorkYear+"."+w.endWorkMonth)
				
				//$("#ico").attr("src", path+data.headIco)
				
				$("#positionName").html(w.positionName)
				
				$("#companyName").html(w.companyName)
				
				$("#projectExperience").html("<h2>项目经验</h2>" + p.projectName + " , " + j.name + "<span class='c9'>("+p.projectYearStart+"."+p.projectMonthStart+"-"+p.projectYearEnd+"."+p.projectMonthEnd+")</span>")
				
				$("#educationYear").html(e.schoolYearStart+"-"+e.schoolYearEnd)		
										
				$("#schoolName").html(e.schoolName)
				
				$("#professionalName").html(e.professionalName+" , " + e.degree)
				
				$("#remark").html(m.describe)
				
				$("#workView").html("网址："+"<a target='_blank' href='" + v.worksAddr + "'>"+v.worksAddr+"</a>")
				
				$("#viewTitle").html(j.name+"的简历")
			}
		})
	}
	
	
	    $("#downLoad").click(function(event) {
			
			window.print()
			
	        ///$("#pagecontent").wordExport('word文档');
	    });
})